class Solution(object):
    def luckyNumbers (self, matrix):
        m = len(matrix)
        n = len(matrix[0])
        out = []
        for i in range(m):
            min_v = min(matrix[i])
            j = matrix[i].index(min_v)
            if max([matrix[i][j] for i in range(m)]) == min_v:
                out.append(matrix[i][j])
        return out